<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file ="../include/base.jsp"%>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="<%=basePath %>css/bootstrap.min.css"/>
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:50px;
		}
		 .gmap3{
			border: 1px dashed #c0c0c0;
			width: 170px;
			height: 100px;
			
		 }
		.mywell{
			margin-top:25px;
		}
	</style>
</head>
<body class="body">
	<%@ include file = "../include/sametop.jsp" %>
	<div class="container">
		<div class="row">
			<jsp:include page="../include/sameleft.jsp">
				<jsp:param value="contact" name="tag"/>
			</jsp:include>
			<div class="span6"  style="border-radius: 3px 3px 0 0;margin-top:10px">
				
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
					<li class="active" style="margin-top:5px"><i class="icon-th"></i>联系人/${contact.name}</li>
				</ul>
				
				<div class="wall " style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:0px;border:1px  solid #dddddd">
										
					<div class="row" style="border-radius: 3px 3px 0 0;margin-left:20px">					
						 <div class="span1">
							<div style="margin-top:30px;border:1px  solid #dddddd;width:60px">
								<img  src="<%=basePath %>img/3.png" />
							</div>
						</div>
						 <div class="span4">
							<div style="width:200px;border-left:none;word-wrap:break-word;margin-top:20px;">
								<div style="margin-left:5px;margin-right:10px;color:darkgray"><span style="font-size:18px"><strong>${contact.name}</strong></span><span style="margin-left:5px">[<a href="<%=basePath%>contact/editcontact.action?id=${contact.id}">编辑此联系人</a>]</span></div>
								<div style="margin-left:3px;margin-top:3px">
									<span style="margin-left:5px;text-decoration:underline">${contact.title}</span>
									在<span style="margin-left:5px;text-decoration:underline">${contact.company}</span>
								</div>
								<div style="margin-left:3px;margin-top:10px">
									<c:forEach items="${contact.tagSet}" var="tag">
										<span style="margin-left:8px;border-radius: 3px 3px 3px 3px;background-color:darkgray;color:white">${tag.content}</span>
									</c:forEach>
									<span style="margin-left:8px;text-decoration:underline" >
										<a href="javaScript:;" onClick="addTag('tag')">添加标签</a>
									</span>
									<div style="margin-left:20px;width:300px;height:120px;position:absolute;z-index:1;border-radius: 3px 3px 0 0;display:none" id="tag" >
										<form method="post" action="<%=basePath%>contact/saveTag2.action?id=${contact.id}">
											<input type="text" name="addtag" value="请输入标签名"/>
												<input type="submit" value="添加">
										</form>
									</div>
								</div>	
							</div>
						</div>												
					</div>
					
					<div style="margin-top:20px;">					
						<ul class="nav nav-tabs">
							  <li class="active" style="font-size:12px"><a href="#home" data-toggle="tab">记录|Email</a></li>
							  <li style="font-size:12px"><a href="#profile" data-toggle="tab">交易机会</a></li>
						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="home">
								<div style="margin-left:10px">
									<div class="wall">							
										<span style="margin-left:20px"><strong>添加一个新记录给tom</strong></span>
										<div style="margin-top:10px">
											<form style="margin-left:15px">
												<textarea name="" id="" style="width:415px" rows="3"></textarea>
												<input type="button"   value="发布" style="float:right;margin-right:10px"/>
											</form>
										</div>
									</div>
									<div style="margin-left:20px;margin-top:30px"><strong>该客户对应的记录</strong></div>
									<hr style="margin-top:30px;width:420px;margin-left:20px">
									<div class="row" style="border-radius: 3px 3px 0 0;margin-top:0px">						 
										 <div class="span1">
											<div style="margin-top:10px;margin-left:20px;border:1px  solid #dddddd;width:60px">
												<img  src="<%=basePath %>img/8.png" />
											</div>
										</div>
										 <div class="span4">
											<div style="width:370px;margin-left:20px;border-left:none;word-wrap:break-word;margin-top:20px;">
												<div style="margin-left:8px;margin-top:3px"><span style="margin-left:5px">发表于一个月前[<a href="">Jerry</a>]</span><span style="float:right;border-radius: 8px 8px 8px 8px;color:black;margin-right:60px"><a href="">修改记录</a></span></div>
												<div style="margin-left:18px;margin-top:10px"><span>能不能便宜点儿.....</span></div>									
											</div>
											<hr style="margin-left:10px">								
										</div>						
									</div> 
									
									<div class="row" style="border-radius: 3px 3px 0 0;margin-top:0px">						 
										 <div class="span1">
											<div style="margin-top:10px;margin-left:20px;border:1px  solid #dddddd;width:60px">
												<img  src="<%=basePath %>img/8.png" />
											</div>
										</div>
										 <div class="span4">
											<div style="width:370px;margin-left:20px;border-left:none;word-wrap:break-word;margin-top:20px;">
												<div style="margin-left:8px;margin-top:3px"><span style="margin-left:5px">发表于一个月前[<a href="">Jerry</a>]</span><span style="float:right;border-radius: 8px 8px 8px 8px;color:black;margin-right:60px"><a href="">修改记录</a></span></div>
												<div style="margin-left:18px;margin-top:10px"><span>能不能便宜点儿.....</span></div>									
											</div>
											<hr style="margin-left:10px">								
										</div>						
									</div> 
								</div>
							</div>
							<div class="tab-pane" id="profile">
								<div style="margin-left:20px;;margin-top:20px"><a class="btn " href="new_project.html"><i class="icon-plus  icon-white"></i>新建一个交易</a></div>
								<div style="margin-left:20px;margin-top:30px"><strong>该客户对应的交易</strong></div>
								<hr style="width:420px;margin-left:20px">
								<div class="row" style="border-radius: 3px 3px 0 0;margin-top:0px">						 
										 <div class="span1">
											<div style="margin-top:20px;margin-left:30px;border:1px  solid #dddddd;width:60px">
												<img  src="<%=basePath %>img/10.png" />
											</div>
										</div>
										 <div class="span4">
											<div style="width:300px;margin-left:20px;border-left:none;word-wrap:break-word;margin-top:20px;">
												<div style="margin-left:8px;margin-top:3px"><span style="margin-left:5px"><strong>想买一套50m平米的房子</strong></span><span style="float:right;border-radius: 8px 8px 8px 8px;color:black;margin-right:60px"><a href="">查看交易</a></span></div>
												<div style="margin-left:18px;margin-top:3px"><span>￥4000</span></div>
												<div style="margin-left:18px;margin-top:3px"><span>负责人：Ann</span></div>												
											</div>
											<hr style="margin-left:10px">								
										</div>						
								</div> 
								<div class="row" style="border-radius: 3px 3px 0 0;margin-top:0px">						 
										 <div class="span1">
											<div style="margin-top:20px;margin-left:30px;border:1px  solid #dddddd;width:60px">
												<img  src="<%=basePath %>img/11.png" />
											</div>
										</div>
										 <div class="span4">
											<div style="width:300px;margin-left:20px;border-left:none;word-wrap:break-word;margin-top:20px;">
												<div style="margin-left:8px;margin-top:3px"><span style="margin-left:5px"><strong>想买一套50m平米的房子</strong></span><span style="float:right;border-radius: 8px 8px 8px 8px;color:black;margin-right:60px"><a href="">查看交易</a></span></div>
												<div style="margin-left:18px;margin-top:3px"><span>￥4000</span></div>
												<div style="margin-left:18px;margin-top:3px"><span>负责人：Ann</span></div>												
											</div>
											<hr style="margin-left:10px">								
										</div>						
								</div> 
							</div>
						</div>
				  </div>				
				</div> 
			</div>
			<div class="span3">
				<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:24px">
						<li class="active"><i class="icon-th"></i>联系人管理</a></li>
						
				</ul>
				<div style="border:1px  solid #dddddd">
					<div style="margin-top:15px;margin-left:25px">
						<a href="<%=basePath%>contact/editcontact.action?id=${contact.id}">修改此联系人信息</a>
					</div><hr>
					<div style="margin-top:15px;margin-left:15px">
						与该联系人相关的日程
						<ul style="margin-top:15px">
							<li><a href="">打电话</a></li>
							<li><a href="">发电子邮件</a></li>
						</ul>
					</div><hr>
					<div style="margin-top:15px;margin-left:15px">
						与该联系人相关的重要事件
						<ul style="margin-top:15px">
							<li><a href="">纪念日</a></li>
							<li><a href="">公司开业</a></li>
						</ul>
					</div><hr>					
					<div style="margin-top:30px;margin-left:15px">
						该联系人信息
						<ul style="margin-top:15px">
							<li>邮箱:
								<c:forEach items="${contact.emailSet}" var="email">
									<div style="margin-left:5px"><a href="">${email.email}</a>[${email.type}]</div>
								</c:forEach>	
							</li>
							<li>手机:
								<c:forEach items="${contact.phoneSet}" var="phone">
									<div style="margin-left:5px">${phone.num}[${phone.type}]</div>
								</c:forEach>
							</li>
							<li>住址
								<div id = "any" class = "gmap3"></div>
								<c:forEach items="${contact.addressSet}" var="address">
									<c:choose>
										<c:when test="${address.type=='家庭'}">
											<div style="margin-left:5px"><span id="myaddress">${address.address}</span>[<a id = "toMap" href = "javascript:;">查看地图</a>]</div>
										</c:when>
										<c:otherwise>
											<div style="margin-left:5px">${address.address}</div>
										</c:otherwise>
									</c:choose>
								</c:forEach>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>	
	</div>
	<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript" src="http://lib.sinaapp.com/js/bootstrap/2.0.3/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/jquery.js"></script>
	<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
    <script type="text/javascript" src="js/gmap3.js"></script> 
	<script type="text/javascript">
	function addTag(id){
			//alert("hehe");
			 var id=document.getElementById(id);
			id.style.display="block"; 
	};
	$(function(){
	alert($("#myaddress").html());
	$('#any').gmap3(
	  {
		action: 'addInfoWindow',
		address:$("#myaddress").html(),
		
		map:{
		  center: true,
		  zoom: 14
		},
		infowindow:{
		  options:{
			size: new google.maps.Size(50,50),
			content: 'Hello World !'
		  },
		  events:{
			closeclick: function(infowindow){
			  //alert('closing : ' + $(this).attr('id') + ' : ' + infowindow.getContent());
			}
		  },
		  apply:[
			{action:'setContent', args:[$("#myaddress").html()]}
		  ]
		}
	  },
	  {action: 'setOptions', args:[{scrollwheel:true}]}
	);
	
	});
	</script>
</body>
</html>
